package com.qiekeji.compiler;

import java.io.FileOutputStream;

import sun.misc.ProxyGenerator;

/**
 * Proxy 动态生成Class
 */
public class ProxyS {
    public static void main(String[] args) {
        String name = IMessage.class.getName() + "Proxy0";
        byte[] bytes = ProxyGenerator.generateProxyClass(name, new Class[]{IMessage.class});
        try {
            FileOutputStream fos = new FileOutputStream("compiler/" + name + ".class");
            fos.write(bytes);
            fos.close();
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
